<template>
  <div class="app-container">
    <!-- 申请表 -->
    <div class="form-blok">
      <div class="source" id="table">
        <!-- 标题 -->
        <h1>广西水利电力职业技术学院家庭经济困难学生认定申请表</h1>

        <!-- 基础信息 -->
        <el-form :model="formData" ref="formData" label-width="0px" size="mini">
          <table class="full-width">
            <tr>
              <td class="table-label rl" rowspan="10">学生基本情况</td>
              <td class="table-label" style="width: 80px;min-width: 80px;"><span class="red-tip">*</span>姓名</td>
              <td class="table-input">
                <el-form-item prop="xm" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.xm" placeholder="请输入姓名"></el-input>
                </el-form-item>
              </td>
              <td class="table-label" style="width: 60px;min-width: 60px;"> <span class="red-tip">*</span>性别</td>
              <td class="table-input">
                <el-form-item prop="xb" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.xb" placeholder="请输入性别"></el-input>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>民族</td>
              <td class="table-input" style="width: 100px;min-width: 100px;">
                <el-form-item prop="mz" :rules="rules">
                  <!--                  <el-input :disabled="this.formData.step >2" v-model="formData.mz" placeholder="请输入民族"></el-input>-->
                  <el-select :disabled="this.formData.step >2" v-model="formData.mz" filterable placeholder="请输入民族">
                    <el-option v-for="item in nation" :key="item" :label="item" :value="item">
                    </el-option>
                  </el-select>

                </el-form-item>
              </td>
              <td class="table-label" style="width: 80px;min-width: 80px;"><span class="red-tip">*</span>出生年月</td>
              <td class="table-input">
                <el-form-item prop="csny" :rules="rules">
                  <el-date-picker :disabled="this.formData.step >2" value-format="yyyy-MM" format="yyyy-MM"
                    v-model="formData.csny" style="width: 120px;" type="date" placeholder="选择日期">
                  </el-date-picker>
                </el-form-item>
              </td>
            <tr>
              <td class="table-label" style="width: 80px;min-width: 80px;"><span class="red-tip">*</span>身份证号</td>
              <td class="table-input" colspan="3">
                <el-form-item prop="sfzhm" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.sfzhm" placeholder="请输入身份证"></el-input>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>学（籍）号</td>
              <td class="table-input" colspan="3">
                <el-form-item prop="xh" :rules="rules">
                  <el-input @blur="inputHandler" :disabled="this.formData.step >2" v-model="formData.xh"
                    placeholder="请输入学号"></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td class="table-label" rowspan="4" style="width: 80px;min-width: 80px;">家庭情况</td>
              <td class="table-label" style="border-left:1px solid #000;">
                <span class="red-tip">*</span>家庭人口数
              </td>
              <td class="table-input" colspan="2">
                <el-form-item prop="rkzs" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.rkzs" placeholder="请输入家庭人口数"></el-input>
                </el-form-item>
              </td>
              <td class="table-label">
                <span class="red-tip">*</span>家庭成员在学人数
              </td>
              <td class="table-input" colspan="3">
                <el-form-item prop="jtcyzxrs" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.jtcyzxrs"
                    placeholder="请输入在学人数"></el-input>
                </el-form-item>
              </td>
              <!-- 选择信息 -->
            <tr>
              <td class="table-label">
                <span class="red-tip">*</span>家庭成员失业人数
              </td>
              <td class="table-input" colspan="2">
                <el-form-item prop="jtcysyrs" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.jtcysyrs"
                    placeholder="请输入失业人数"></el-input>
                </el-form-item>
              </td>
              <td class="table-label">
                <span class="red-tip">*</span>赡养人数
              </td>
              <td class="table-input" colspan="3">
                <el-form-item prop="syrs" :rules="rules">
                  <el-input :disabled="this.formData.step >2" v-model="formData.syrs" placeholder="请输入赡养人数"></el-input>
                </el-form-item>
              </td>
            <tr>
              <td class="table-input" colspan="7" style="text-align: left;">
                <h4><span class="red-tip">*</span>家庭情况（如实在相应类型□中打“√”）</h4>
                <div>
                  <el-row class="radio-group-row">
                    <div class="radio-group">
                      <el-form-item prop="knlx" :rules="selerules">
                        <el-radio-group v-model="formData.knlx">
                          <el-radio :label="'脱贫家庭学生'" :disabled="formData.step >2">脱贫家庭学生</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </div>
                    <div v-show="formData.knlx == '脱贫家庭学生'">
                      <el-form-item prop="knlx2">
                        <span style="margin-right:10px;">脱贫年度: </span>
                        <el-radio-group v-model="formData.knlx2">
                          <el-radio :label="'2014年/2015年'" :disabled="formData.step >2">2014年/2015年</el-radio>
                          <el-radio :label="'2016年及以后'" :disabled="formData.step >2">2016年及以后</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </div>
                  </el-row>
                </div>
                <div>
                  <el-row class="radio-group-row">
                    <div class="radio-group">
                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'监测对象家庭学生'" fill="#000000" :disabled="formData.step >2">监测对象家庭学生</el-radio>
                      </el-radio-group>
                    </div>
                    <div v-show="formData.knlx == '2'">
                      <el-form-item prop="knlx2">
                        <el-radio-group v-model="formData.knlx2">
                          <el-radio :label="'脱贫不稳定家庭学生'" :disabled="formData.step >2">脱贫不稳定家庭学生</el-radio>
                          <el-radio :label="'边缘易致贫家庭学生'" :disabled="formData.step >2">边缘易致贫家庭学生</el-radio>
                          <el-radio :label="'突发严重困难家庭学生'" :disabled="formData.step >2">突发严重困难家庭学生</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </div>
                  </el-row>
                </div>
                <div>
                  <el-row class="radio-group-row">
                    <div class="radio-group">

                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'特困救助供养学生'" :disabled="formData.step >2">特困救助供养学生</el-radio>
                      </el-radio-group>

                    </div>
                    <div v-show="formData.knlx == '3'">
                      <el-form-item prop="knlx2">
                        <el-radio-group v-model="formData.knlx2">
                          <el-radio :label="'城市'" :disabled="formData.step >2">城市</el-radio>
                          <el-radio :label="'农村'" :disabled="formData.step >2">农村</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </div>
                  </el-row>
                </div>
                <div>
                  <el-row class="radio-group-row">
                    <div class="radio-group" @click="()=>{formData.knlx2==0}">
                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'家庭经济困难残疾学生'" :disabled="formData.step >2">家庭经济困难残疾学生</el-radio>
                      </el-radio-group>

                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'家庭经济困难残疾人子女'" :disabled="formData.step >2">家庭经济困难残疾人子女</el-radio>
                      </el-radio-group>
                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'孤儿'" :disabled="formData.step >2">孤儿</el-radio>
                      </el-radio-group>

                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'事实无人抚养儿童'" :disabled="formData.step >2">事实无人抚养儿童</el-radio>
                      </el-radio-group>
                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'烈士子女'" :disabled="formData.step >2">烈士子女</el-radio>
                      </el-radio-group>

                      <el-radio-group v-model="formData.knlx">
                        <el-radio :label="'建档困难职工家庭学生'" :disabled="formData.step >2">建档困难职工家庭学生</el-radio>
                      </el-radio-group>
                    </div>
                  </el-row>
                </div>
                <el-row class="radio-group-row">
                  <div class="radio-group">
                    <el-radio-group v-model="formData.knlx">
                      <el-radio :label="'低收入对象'" :disabled="formData.step >2">低收入对象</el-radio>
                    </el-radio-group>
                  </div>
                  <div v-show="formData.knlx == '11'">
                    <el-form-item prop="knlx2">
                      <el-radio-group v-model="formData.knlx2">
                        <el-radio :label="'低保边缘家庭学生'" :disabled="formData.step >2">低保边缘家庭学生</el-radio>
                        <el-radio :label="'支出型困难家庭学生'" :disabled="formData.step >2">支出型困难家庭学生</el-radio>
                      </el-radio-group>
                    </el-form-item>
                  </div>
                </el-row>
                <el-row class="radio-group-row">
                  <div class="radio-group">

                    <el-radio-group v-model="formData.knlx" @input="resetknlx2">
                      <el-radio :label="'其他家庭经济困难学生'" :disabled="formData.step >2">其他家庭经济困难学生</el-radio>
                    </el-radio-group>

                  </div>
                  <div v-show="formData.knlx == '其他家庭经济困难学生'">
                    <el-form-item prop="knlx2">
                      （请简述原因） <el-input v-model="formData.knlx2" placeholder="请输入"
                        :disabled="formData.step >2"></el-input>
                    </el-form-item>
                  </div>
                </el-row>
              </td>
            </tr>
          </table>
          <table class="full-width">
            <!-- 家庭信息 -->
            <tr>
            <tr>
              <td rowspan="4" style="writing-mode:vertical-rl;" class="table-label">家庭信息</td>
            </tr>
            <tr>
              <td class="table-label"><span class="red-tip">*</span>户籍性质</td>
              <td class="table-input table-align-left">
                <el-form-item prop="hjxz" :rules="selerules">
                  <el-radio-group v-model="formData.hjxz">
                    <el-radio :label="'城镇'" :disabled="formData.step >2">城镇</el-radio>
                    <el-radio :label="'农村'" :disabled="formData.step >2">农村</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>户籍所在地</td>
              <td class="table-input" colspan="4">
                <el-form-item prop="hjszd" style="max-height: 80px;" :rules="rules">
                  <el-input type="textarea" :rows="2" placeholder=" 省(区)/市/县" v-model="formData.hjszd"
                    :disabled="formData.step >2">
                  </el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td class="table-label"><span class="red-tip">*</span>家长姓名</td>
              <td class="table-input" colspan="2">
                <el-form-item prop="jzdh" :rules="rules">
                  <el-input v-model="formData.jzdh" placeholder="家长姓名" :disabled="formData.step >2"></el-input>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>联系电话</td>
              <td class="table-input" colspan="2">
                <el-form-item prop="parentstel">
                  <el-input v-model="formData.parentstel" placeholder="联系电话" type="number"
                    :disabled="formData.step >2"></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td class="table-label"><span class="red-tip">*</span>家庭居住房产（住房）情况</td>
              <td class="table-input table-align-left" colspan="3">
                <el-form-item prop="jtjzfqk" :rules="selerules">
                  <el-radio-group v-model="formData.jtjzfqk">
                    <el-radio :label="'1'" :disabled="formData.step >2">商品房</el-radio>
                    <el-radio :label="'2'" :disabled="formData.step >2">单位福利住房</el-radio>
                    <el-radio :label="'3'" :disabled="formData.step >2">自建房</el-radio>
                    <el-radio :label="'4'" :disabled="formData.step >2">租房、无房</el-radio>
                    <el-radio :label="'5'" :disabled="formData.step >2">其他</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
              <td class="table-label"><span class="red-tip">*</span>家中有汽车情况</td>
              <td class="table-input table-align-left" colspan="3">
                <el-form-item prop="jtqcqk" :rules="selerules">
                  <el-radio-group v-model="formData.jtqcqk">
                    <el-radio :label="'1'" :disabled="formData.step >2">自用</el-radio>
                    <el-radio :label="'2'" :disabled="formData.step >2">经营用</el-radio>
                    <el-radio :label="'3'" :disabled="formData.step >2">无汽车</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td class="table-label"><span class="red-tip">*</span>家庭居住现居住地址</td>
              <td class="table-input" colspan="7">
                <div>
                  <el-form-item prop="jtxjzdz" :rules="rules">
                    <el-input :disabled="formData.step >2" placeholder="省（自治区）/市/县（市、区）/镇（街道）/村（居委）/（门牌号）"
                      v-model="formData.jtxjzdz">
                    </el-input>
                  </el-form-item>
                </div>
              </td>
            </tr>
          </table>
          <table class="full-width">

            <!-- 家庭成员情况 -->
            <tr>
            <tr>
              <td rowspan="4" style="writing-mode:vertical-rl;" class="table-label">家庭成员情况</td>
            </tr>
            <tr>
              <td style="padding:0px;" colspan="7">
                <el-table :data="formData.jtcyObj" border style="width: 100%" :row-class-name="handelIndex">
                  <el-table-column prop="xm" label="姓名" width="80" align="center">

                  </el-table-column>
                  <el-table-column prop="nl" label="年龄" width="80" align="center">

                  </el-table-column>
                  <el-table-column prop="gx" label="与学生关系" width="80" align="center">

                  </el-table-column>
                  <el-table-column prop="dw" label="工作（学习）单位" width="140" align="center">

                  </el-table-column>

                  <!--                  要加字段-->
                  <el-table-column prop="tel" label="联系电话" width="135" align="center">

                  </el-table-column>

                  <el-table-column prop="zy" label="职业" width="82" align="center">

                  </el-table-column>
                  <el-table-column prop="nsr" label="年收入（元）" width="80" align="center">

                  </el-table-column>
                  <el-table-column prop="jkzk" label="健康状况" width="100" align="center">

                  </el-table-column>
                  <!--  <el-table-column label="操作" align="center" v-if="formData.step==1 || this.formData.step == 0">
                    <template slot-scope="data">
                      <el-button type="text" @click="handelDel(data.row)">删除</el-button>
                    </template>
                  </el-table-column> -->
                </el-table>
                <div style="padding: 5px;" v-if="formData.step==1">
                  <!-- 注意：该部分内容编辑请到个人信息家庭成员处修改<div style="color: blue;" @click="goEditInfo">点击跳转</div> -->
                  <el-button id="editFamily" @click="dialogTableVisible = true" type="text">编辑家庭成员</el-button>
                </div>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <div style="display: flex;align-items: center;">
                  <span class="red-tip">*</span>家庭年收入
                  <el-form-item prop="jtnsr">
                    <el-input type="number" v-model="income" placeholder="自动计算家庭年收入" disabled />
                  </el-form-item>
                  元
                </div>
              </td>
              <td colspan="5">
                <div style="display: flex;align-items: center;">
                 <span class="red-tip">*</span> 人均年收入
                  <el-form-item prop="rjnsr">
                    <el-input type="number" v-model="capita" placeholder="自动计算人均年收入" disabled />
                  </el-form-item>
                  元
                </div>
              </td>
            </tr>


          </table>
          <table class="full-width2">
            <!-- 影响家庭经济状况信息 -->
            <tr>
            <tr>
              <td rowspan="4" style="writing-mode:vertical-rl;" class="table-label">影响家庭经济状况信息</td>
            </tr>
            <tr>
              <td style="text-align: left;" colspan="7">
                <h4><span class="red-tip">*</span>1.家庭经济主要收入来源情况（如实在相应类型□中打“√”）</h4>
                <div>
                  <el-row class="radio-group-row">
                    <div class="radio-group">
                      <el-form-item prop="jtzysr" :rules="selerules">
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'关事业单位公职人员'" :disabled="formData.step >2">关事业单位公职人员</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'单位公司合同制职工'" :disabled="formData.step >2">单位公司合同制职工</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'私营业主'" :disabled="formData.step >2">私营业主</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'个体工商户'" :disabled="formData.step >2">个体工商户</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'务工'" :disabled="formData.step >2">务工</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'务农'" :disabled="formData.step >2">务农</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'无固定收入'" :disabled="formData.step >2">无固定收入</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="formData.jtzysr">
                          <el-radio :label="'无收入'" :disabled="formData.step >2">无收入</el-radio>
                        </el-radio-group>
                      </el-form-item>
                      <el-row class="radio-group-row">
                        <div class="radio-group">
                          <el-radio-group v-model="formData.jtzysr">
                            <el-radio :label="'其他收入'" :disabled="formData.step >2">其他收入（简要说明） </el-radio>
                          </el-radio-group>
                        </div>
                        <div v-if="formData.jtzysr == '其他收入'">
                          <el-form-item prop="jtzysr2" :rules="rules">
                            （请简述原因） <el-input v-model="formData.jtzysr2" :disabled="formData.step >2"
                              placeholder="请其他收入（简要说明）"></el-input>
                          </el-form-item>
                        </div>
                      </el-row>

                    </div>
                  </el-row>
                </div>
                <div style="margin-top: 10px;">
                  <el-row class="radio-group-row">
                    <el-form-item prop="jtzysr" :rules="rules">
                      <div class="radio-group">
                        <span class="red-tip">*</span>2.学生父母丧失劳动能力或劳动能力弱 <el-input :disabled="formData.step >2" v-model="formData.ssldnl"
                          placeholder="" style="width: 100px; border-bottom: 1px solid #e5e5e5;"></el-input>人；
                        需赡养丧失劳动能力的共同生活家庭成员<el-input :disabled="formData.step >2" v-model="formData.zyssldnl"
                          placeholder="" style="width: 100px; border-bottom: 1px solid #e5e5e5;"></el-input>人（其中长期患病或残疾
                        <el-input :disabled="formData.step >2" v-model="formData.hbcjr" placeholder=""
                          style="width: 100px; border-bottom: 1px solid #e5e5e5;"></el-input>
                        人）。
                      </div>
                    </el-form-item>
                  </el-row>
                </div>
                <h4><span class="red-tip">*</span>3.如有以下情形，请如实勾选并简要描述：</h4>
                <div>
                  <!-- 家庭遭受疫情 □家庭遭受自然灾害 □家庭遭受突发意外事件  □家庭欠债 -->
                  <el-row class="radio-group-row">
                    <div class="radio-group">
                      <el-radio-group v-model="formData.tfsj">
                        <el-radio :label="'家庭遭受疫情'" :disabled="formData.step >2">家庭遭受疫情</el-radio>
                      </el-radio-group>
                      <el-radio-group v-model="formData.tfsj">
                        <el-radio :label="'家庭遭受自然灾害'" :disabled="formData.step >2">家庭遭受自然灾害</el-radio>
                      </el-radio-group>
                      <el-radio-group v-model="formData.tfsj">
                        <el-radio :label="'家庭遭受突发意外事件'" :disabled="formData.step >2">家庭遭受突发意外事件</el-radio>
                      </el-radio-group>
                      <el-row class="radio-group-row">
                        <div class="radio-group">
                          <el-radio-group v-model="formData.tfsj">
                            <el-radio :label="'家庭欠债'" :disabled="formData.step >2">家庭欠债</el-radio>
                          </el-radio-group>
                        </div>
                        <div v-show="formData.tfsj == '4'">
                          具体时间、内容及涉及金额等情况<el-input :disabled="formData.step >2" v-model="formData.tfsj2"
                            placeholder=""></el-input>
                        </div>
                      </el-row>
                      <el-row class="radio-group-row">
                        <div class="radio-group">
                          <el-radio-group v-model="formData.tfsj">
                            <el-radio :label="'5'" :disabled="formData.step >2">其它情况</el-radio>
                          </el-radio-group>
                        </div>
                        <div v-show="formData.tfsj == '5'">
                          （请简述原因） <el-input :disabled="formData.step >2" v-model="formData.tfsj3"
                            placeholder="请填写其他情况"></el-input>
                        </div>
                      </el-row>
                    </div>
                  </el-row>
                </div>
              </td>
            </tr>
          </table>
          <!-- 承诺书 -->
          <table class="full-width2">
            <tr>
              <td class="table-label rl"></td>
              <td style="text-align: left;">
                <div>本人承诺以上所填资料真实、准确，并同意授权相关部门通过信息核对，对所填资料进行查询、核对。
                  如虚报资料，本人愿意承担相关责任。</div>
                <div style="display: flex; justify-content: flex-end;margin-right: 100px;">
                  <span><span class="red-tip">*</span> 手写签字：</span>
                  <span>
                    <el-upload :disabled="formData.step >1" class="avatar-uploader" :action="upload.url"
                      :headers="upload.headers" :show-file-list="false" :on-success="handleSignatureSuccess">
                      <img v-if="formData.sqrqm" :src="baseurl+formData.sqrqm" class="signature-img">
                      <span class="signature-tip" v-else>签名</span>
                    </el-upload>
                  </span>
                </div>

                <div style="text-align: right;">{{formData.sqrqmrq}}</div>
              </td>
            </tr>
          </table>
          <!-- 班级评议意见 -->
          <table class="full-width2">
            <tr>
              <td class="table-label rl" style="width: 100px;">辅导员意见</td>
              <td style="text-align: left;">
                <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经班级评议小组民主评议，认为该生（□符合 □不符合）家庭经济困难学生认定条件，推荐认定困难类型为：</div>
                <el-row class="radio-group-row">
                  <div class="radio-group">
                    <el-radio-group v-model="formData.bjpyyj">
                      <el-radio :label="'1'" :disabled="formData.step!=2 || this.state==1">特别困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.bjpyyj">
                      <el-radio :label="'2'" :disabled="formData.step!=2 || this.state==1">比较困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.bjpyyj">
                      <el-radio :label="'3'" :disabled="formData.step!=2 || this.state==1">一般困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.bjpyyj">
                      <el-radio :label="'4'" :disabled="formData.step!=2 || this.state==1">不困难</el-radio>
                    </el-radio-group>
                  </div>
                </el-row>
                <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                  <span> <span class="red-tip">*</span> 辅导员签字：</span>
                  <span>
                    <el-upload :disabled="this.formData.step != 2 || this.state==1" class="avatar-uploader"
                      :action="upload.url" :headers="upload.headers" :show-file-list="false"
                      :on-success="handleFdySignatureSuccess">
                      <img v-if="formData.fdyqm" :src="baseurl+formData.fdyqm" class="signature-img">
                      <span class="signature-tip" v-else>签名</span>
                    </el-upload>
                  </span>
                </div>
                <div style="text-align: right;">{{formData.fdyqmrq}}</div>
              </td>
            </tr>
          </table>

          <!-- 二级学院认定意见 -->
          <table class="full-width2">
            <tr>
              <td class="table-label rl" style="width: 100px;">二级学院认定意见</td>
              <td style="text-align: left;">
                <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经学院认定工作组审查，本学年该□同学符合；□不符合家庭经济困难学生认定条件；认定困难类型为：</div>
                <el-row class="radio-group-row">
                  <div class="radio-group">
                    <el-radio-group v-model="formData.ejxyldqmyj">
                      <el-radio :label="'1'" :disabled="formData.step!=3 || this.state==1">特别困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.ejxyldqmyj">
                      <el-radio :label="'2'" :disabled="formData.step!=3 || this.state==1">比较困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.ejxyldqmyj">
                      <el-radio :label="'3'" :disabled="formData.step!=3 || this.state==1">一般困难</el-radio>
                    </el-radio-group>
                    <el-radio-group v-model="formData.ejxyldqmyj">
                      <el-radio :label="'4'" :disabled="formData.step!=3 || this.state==1">不困难</el-radio>
                    </el-radio-group>
                  </div>
                </el-row>
                <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                  <span><span class="red-tip">*</span>  二级学院负责人签字：</span>
                  <span>
                    <el-upload :disabled="this.formData.step != 3 || this.state==1" class="avatar-uploader"
                      :action="upload.url" :headers="upload.headers" :show-file-list="false"
                      :on-success="handleEjxyldSignatureSuccess">
                      <img v-if="formData.ejxyldqm" :src="baseurl+formData.ejxyldqm" class="signature-img">
                      <span class="signature-tip" v-else>签名</span>
                    </el-upload>
                  </span>
                </div>
                <div style="text-align: right;"> {{formData.ejxyldqmrq}}</div>
                <div style="text-align: right;">（加盖二级学院公章）</div>
              </td>
            </tr>
          </table>
          <!-- 学校审核意见 -->
          <table class="full-width2">
    
            <tr>
              <td rowspan="4" style="writing-mode:vertical-rl; width: 100px;" class="table-label">学校审核意见</td>
            </tr>
            <tr>
            <td style="text-align: left;">
              <div style="margin: 10px 10px;"><span class="red-tip">*</span> 经学校学生资助工作领导小组审查，经5个工作日公示无异议，认定该生（□符合 □不符合）家庭经济困难学生认定条件，同意认定困难类型为：</div>
              <el-row class="radio-group-row">
                <div class="radio-group">
                  <el-radio-group v-model="formData.xsqmyj">
                    <el-radio :label="'1'" :disabled="formData.step!=4 || this.state==1">特别困难</el-radio>
                  </el-radio-group>
                  <el-radio-group v-model="formData.xsqmyj">
                    <el-radio :label="'2'" :disabled="formData.step!=4 || this.state==1">比较困难</el-radio>
                  </el-radio-group>
                  <el-radio-group v-model="formData.xsqmyj">
                    <el-radio :label="'3'" :disabled="formData.step!=4 || this.state==1">一般困难</el-radio>
                  </el-radio-group>
                  <el-radio-group v-model="formData.xsqmyj">
                    <el-radio :label="'4'" :disabled="formData.step!=4 || this.state==1">不困难</el-radio>
                  </el-radio-group>
                </div>
              </el-row>
              <div style="display: flex; justify-content: flex-end;margin-right: 100px;margin-top: 5px;">
                <span> <span class="red-tip">*</span> 学校负责人签字：</span>
                <span>
                  <el-upload :disabled="this.formData.step != 4 || this.state==1" class="avatar-uploader"
                    :action="upload.url" :headers="upload.headers" :show-file-list="false"
                    :on-success="handleXuexiaoSignatureSuccess">
                    <img v-if="formData.xsqm" :src="baseurl+formData.xsqm" class="signature-img">
                    <span class="signature-tip" v-else>签名</span>
                  </el-upload>
                </span>
              </div>
              <div style="text-align: right;"> {{formData.xsqmrq}}</div>
              <div style="text-align: right;">（加盖学校公章）</div>
            </td>
            </tr>

          </table>
          <table style="border-collapse: collapse; width: 100%;" id="cailiao">
            <tr>
              <td rowspan="4" style="writing-mode:vertical-rl; width: 100px;" class="table-label">困难佐证材料</td>
              <td class="" colspan="7" style="min-width: 500px;">
                <Affix :notupload="formData.step==2" :accpet="accpet"  @input="handleAffix" v-model="formData.affixId" :maxSize="0.5">
                </Affix>
              </td>
            </tr>
          </table>

        </el-form>

      </div>
      <div style="margin: 10px  ;text-align: center;">
        <!-- 辅导员也可以修改信息 -->
         <el-button type="success" v-if="formData.step == 2" @click="fdySave">保存信息</el-button>
        <el-button type="success" v-if="formData.step == 1 || formData.step==0" @click="onSubmit(0)">保存信息</el-button>
        <el-button type="primary" v-if="formData.step == 1 || formData.step==0" @click="onSubmit(1)">提交申请</el-button>

        <el-button type="success" v-if="formData.step!=0" @click="printHtml">打印</el-button>

        <el-button type="primary" v-if="formData.step == 2 && this.state==0" @click="onSubmit(2)">确认提交</el-button>
        <el-button type="primary" v-if="formData.step == 3 && this.state==0" @click="onSubmit(3)">确认提交</el-button>
        <el-button type="primary" v-if="formData.step == 4 && this.state==0" @click="onSubmit(4)">确认提交</el-button>
        <!-- <el-button v-if="formData.step != 1 && formData.step != 5" type="danger" @click="on">审核不通过</el-button> -->
      </div>
      注：1.本表供学生根据需要申请家庭经济困难认定用，可复印。2.选择性项目必须填写。3.学校审核意见负责人签章（盖章）：高等学校为校学生资助工作领导小组组长或学生资助中心主要负责人签章，加盖资助中心公章；其他学段学校为学校校长签章，加盖学校公章。

      <el-dialog title="编辑家庭成员" width="1600px" top="25vh" :visible.sync="dialogTableVisible" @close="getFamily">
        <FamilyMember />
      </el-dialog>
      <!-- <div>
        <div>
          审批流程
        </div>
        <div class="list">
          <div class="item" v-for="(item,index) in recordList" :key="index">
            <div>
              <span>{{item.createTime}}</span>
              <span>{{item.approver}}</span>
              <span v-if="item.step == 1">提交申请</span>
              <span v-if="item.step == 2">辅导员审核</span>
              <span v-if="item.step == 3">二级领导审核</span>
              <span v-if="item.step == 4">学校意见</span>
            </div>
            <div v-if="item.status == '0'">
              <span>审核不通过: </span>
              <span>{{item.remark}}</span>
            </div>
            <div v-else>
              <span v-if="item.step != 1">
                审核通过
              </span>
            </div>
          </div>
        </div>
      </div> -->
      <div class="record">
        <div class="title">
          <span>审核记录</span>

        </div>
        <el-timeline v-loading="recordLoading">
          <el-timeline-item v-for="(item,index) in recordList" :key="index" :icon="item.icon" size="large"
            :type='item.type' :timestamp="item.createTime" placement="top">
            <el-card>
                     <!-- <h3 v-if="item.step == 0 ">保存</h3>
              <h3 v-if="item.step == 1 ">提交申请</h3> -->
              <h3 v-if="item.step == 2 ">
                <p>
                  <span>辅导员审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                </p>

              </h3>
              <h3 v-if="item.step == 3 ">
                <p>
                  <span>二级学院审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                </p>
              </h3>
              <h3 v-if="item.step == 4 ">
                <p>
                  <span>学校审核：</span>
                  <span v-if="item.status==1" style="color:#55aa00">特别困难</span>
                  <span v-if="item.status==2" style="color:#55aa00">比较困难</span>
                  <span v-if="item.status==3" style="color:#55aa00">一般困难</span>
                  <span v-if="item.status==4" style="color:#ff2200">不困难</span>
                </p>
              </h3>
              <p>操作人：{{item.approver}} </p>
            </el-card>
          </el-timeline-item>
        </el-timeline>
      </div>
    </div>
  </div>
</template>

<script>
  import { queryByStuNo } from "@/api/comprehensive/knrdtype";
import {
  getOwnInfo
} from "@/api/stuCQS/basedata/extraInfo";
import {
  getOwnFamily
} from "@/api/stuCQS/basedata/member";
import { getUserProfile, updateSignature } from "@/api/system/user";
import {
  addApply,
  fdySave,
  getApply,
  getStuByXh,
  getxh,
  infoCheck,
  nopass,
  updateApply
} from "@/api/zxj/poverty/apply";
import {
  listRecord
} from "@/api/zxj/poverty/record";
import {
  getToken
} from "@/utils/auth";
import FamilyMember from "@/views/basedata/private/components/FamilyMember.vue";
import {
  Message
} from 'element-ui';

    export default {
    components: {
      FamilyMember
    },
    data() {
      return {
        user:{signature:null},
        accpet:'image/*',
        recordLoading: false,
        dialogTableVisible: false,
        upload: {
          headers: {
            Authorization: "Bearer " + getToken()
          },

          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/common/upload"
        },
        baseurl: process.env.VUE_APP_BASE_API + "/",

        formData: {
          "jtzysr2": "",
          "parentstel": "",
          "affixId": null,
          "createBy": "",
          "createTime": "",
          "updateBy": "",
          "updateTime": "",
          "remark": "",
          "id": "",
          "step": 1,
          "xm": "",
          "xb": "",
          "mz": "",
          "sfzhm": "",
          "xh": "",
          "csny": "",
          "knlx": "",
          "knlx2": "",
          "rkzs": "",
          "srly": "",
          "hjxz": "",
          "hjszd": "",
          jtcyObj: [

          ],
          jtcy: [{
            xm: "",
            nl: "",
            yxsgx: "",
            gzdw: "",
            zy: "",
            nsr: "",
            jkzk: "",
            gx: ""
          }],
          "jtjzfqk": null,
          "jtqcqk": null,
          "jtxjzdz": null,
          "jzdh": null,
          "jtnsr": null,
          "rjnsr": null,
          "jtzysr": null,
          "ssldnl": null,
          "hbcjr": null,
          "zyssldnl": null,
          "tfsj": null,
          "sqrqm": null,
          "sqrqmrq": "",
          "bjpyyj": null,
          "pyxzzzqm": null,
          "pyxzzzqmrq": null,
          "ejxyfzrqm": "",
          "fdyqm": null,
          "fdyqmrq": "",
          "ejxyldqmyj": null,
          "ejxyldqm": "",
          "ejxyldqmrq": "",
          "xsqmyj": null,
          "xsqm": "",
          "xsqmrq": "",
          "createId": null,
          "xsqmyjstate": null,
          "ejxyldqmyjstate": null,
          "bjpyyjstate": null
        },
        rules: [{
          required: true,
          message: '此项必填'
        }],
        rulestel: [{
          required: true,
          message: '此项必填'
        }, {
          min: 11,
          max: 11,
          message: "只能输入11位数字"
        }],
        selerules: [{
          required: true,
          message: '必选一项'
        }],
        state: 0,
        index: null,
        recordList: [],
        data: [],
        indexs: 0,
        nation: [
          "阿昌族",
          "鄂温克族",
          "傈僳族",
          "水族",
          "白族",
          "高山族",
          "珞巴族",
          "塔吉克族",
          "保安族",
          "仡佬族",
          "满族",
          "塔塔尔族",
          "布朗族",
          "哈尼族",
          "毛南族",
          "土家族",
          "布依族",
          "哈萨克族",
          "门巴族",
          "土族",
          "朝鲜族",
          "汉族",
          "蒙古族",
          "佤族",
          "达斡尔族",
          "赫哲族",
          "苗族",
          "维吾尔族",
          "傣族",
          "回族",
          "仫佬族",
          "乌孜别克族",
          "德昂族",
          "基诺族",
          "纳西族",
          "锡伯族",
          "东乡族",
          "京族",
          "怒族",
          "瑶族",
          "侗族",
          "景颇族",
          "普米族",
          "彝族",
          "独龙族",
          "柯尔克孜族",
          "羌族",
          "裕固族",
          "俄罗斯族",
          "拉祜族",
          "撒拉族",
          "藏族",
          "鄂伦春族",
          "黎族",
          "畲族",
          "壮族",
        ]
      }
    },
    destroyed() {
      localStorage.setItem("knList", "[]")
    },
    created() {
      //获取
      let date = new Date();
      let month = date.getMonth() + 1
      if (this.formData.step == 1) {
        this.formData.sqrqmrq = date.getFullYear() + "年" + month + "月" + date.getDate() + "日";
      }
      let id = this.$route.query.id
      this.state = this.$route.query.she ? this.$route.query.she : 0
      this.data = JSON.parse(localStorage.getItem("knList"))
      // let id = 22;
      if (id) { //存在id是编辑
        this.getRecordList(id)
        this.getInfo(id, date, month)
        this.getUserSignature();
      } else { //添加，初始化数据
        infoCheck().then(res => {

          if (res.code == 0) {

            if (res.data.code == 0) {

              this.$alert("贫困认定前需要完善个人信息，立即完善1", '提示', {
                confirmButtonText: '确定',
                type: 'warning'
              }).then(() => {
                this.$router.push({
                  path: "/basedata/stuOwnInfo/edit"
                })
              }).catch(() => {
                this.$tab.closePage();
              });
            } else {

              this.$alert(res.msg, '提示', {
                confirmButtonText: '确定',
                type: 'warning'
              }).then(() => {
                this.$tab.closePage();
              }).catch(() => {
                this.$tab.closePage();
              });
            }

          } else {
            this.init();
            this.getUserSignature();
          }
        })

      }

    },
    methods: {

      getUserSignature() {
            getUserProfile().then(response => {
             
                if(this.formData.step == 2 && !this.formData.fdyqm  ){
                    console.log("获取辅导员签名");
                    this.formData.fdyqm = response.data.signature;
                }
                if(this.formData.step == 3 && !this.formData.ejxyldqm){
                     console.log("获取二级学院领导签名");
                    this.formData.ejxyldqm = response.data.signature;
                }
                if(this.formData.step == 4 && !this.formData.xsqm){
                     console.log("获学校领导签名");
                    this.formData.xsqm = response.data.signature;
                }
                if(this.formData.step == 1 && !this.formData.sqrqm){
                    console.log("获取学生签名");
                    this.formData.sqrqm= response.data.signature;
                }
            });    
        },
      getLabel(index) {
        if (index == 1) {
          return "特别困难"
        } else if (index == 2) {
          return "比较困难"
        } else if (index == 2) {
          return "一般困难"
        } else if (index == 2) {
          return "不困难"
        }
      },
      //查询审核记录
      getRecordList(id) {
        // 查询审批流程
        this.recordLoading = true;
        listRecord({
          applyId: id
        }).then(response => {
          this.recordList = [];
          let rows = response.rows;
          for (let idx = 0; idx < rows.length; idx++) {
            let row = rows[idx];
            if (row.step == 0) {
              row['text'] = "保存";
            }
            if (row.step == 1) {
              row['text'] = "提交申请";
            }
            if (row.step == 2) {
              row['text'] = "辅导员审核";
            }
            if (row.step == 3) {
              row['text'] = "二级学院审核";
            }
            if (row.step == 4) {
              row['text'] = "学校审核";
            }
            //el-icon-remove-outline el-icon-circle-check el-icon-circle-close
            if (row.status == '0') {
              //拒绝
              row['icon'] = 'el-icon-circle-close';
              row['color'] = '#F56C6C'
              row['type'] = 'danger';
              row['result'] = "拒绝";
            }
            if (row.status == '1') {
              //通过
              row['icon'] = 'el-icon-circle-check';
              row['color'] = '#67C23A'
              row['type'] = 'success';
              row['result'] = "审核通过";
            }

            if (row.status == '2') {
              // 驳回
              row['icon'] = 'el-icon-remove-outline';
              row['color'] = '#E6A23C'
              row['type'] = 'warning';
              row['result'] = "驳回";
            }

            this.recordList.push(row);
          }
          this.recordLoading = false;


        });
      },
      getInfo(id, date, month) {
        getApply(id).then(response => {
          this.formData = {
            ...this.formData,
            ...response.data
          }
          this.formData.jtcyObj = JSON.parse(response.data.jtcy);
          if (this.$route.query.show) { //学生进来只进行查看
            this.formData.step = 5
          }
          // console.log(this.$route.query.edit && this.formData.step == 2);
          if (this.$route.query.edit && this.formData.step == 2) { //学生进来，且辅导员没有审核
            this.formData.step = 1
          }
          if (this.formData.step == 2) {
            this.formData.fdyqmrq = date.getFullYear() + "年" + month + "月" + date.getDate() + "日";
          }
          if (this.formData.step == 3) {
            this.formData.ejxyldqmrq = date.getFullYear() + "年" + month + "月" + date.getDate() + "日";
          }
          if (this.formData.step == 4) {
            this.formData.xsqmrq = date.getFullYear() + "年" + month + "月" + date.getDate() + "日";
          }
          // this.getFamily()
        });
      },
      init() {
        getxh().then(res => {
          if (res.code == 200) {
            this.formData.xh = res.data.stuNo;
            this.formData.sfzhm = res.data.idCard
            this.formData.xm = res.data.name
            this.formData.xb = res.data.gender
            this.formData.csny = res.data.birthday
            this.getOwnInfo()
            this.getFamily()
            this.getKnlx()
          }
        })
      },
      getKnlx(){
        queryByStuNo({stuNo: this.formData.xh}).then(res=>{
            if(res.code == 200 && !res.data){
                this.formData.knlx = res.data.knrdType
            }
        })
      },
      getOwnInfo() {
        getOwnInfo().then(obj => {
          this.formData.mz = obj.data.mz
          this.formData.hjxz = obj.data.hkxz
          this.formData.hjszd = obj.data.hksz1 + obj.data.hksz2 + obj.data.hksz3
          this.formData.jtxjzdz = obj.data.xxlxdz
        })
      },
      getFamily() {
        getOwnFamily().then(obj => {
          if (obj.code == 200) {
            var arr = obj.data
            this.formData.jtcyObj = []
            if (arr.length > 0) {
              for (var i = 0; i < arr.length; i++) {

                var obj = {}
                obj.xm = arr[i].familyName
                obj.nl = arr[i].age
                obj.gx = arr[i].familyRelation
                if (arr[i].familyRelation.indexOf("父子") || arr[i].familyRelation.indexOf("母子") ||
                  arr[i].familyRelation.indexOf("父女") || arr[i].familyRelation.indexOf("母女")) {
                  this.formData.jzdh = arr[i].familyName
                  this.formData.parentstel = arr[i].phone
                }
                obj.gzdw = arr[i].workPlace
                obj.zy = arr[i].job
                obj.jkzk = arr[i].health
                obj.tel = arr[i].phone
                obj.nsr = arr[i].yearMoney
                obj.dw = arr[i].workPlace
                this.formData.jtcyObj.push(obj)
                this.formData.rkzs = arr.length + 1
              }
            }
          }
        });
      },
      printHtml() {
        const style = '@page {margin:0 10mm};'
        printJS({
          printable: 'table', // 标签元素id
          type: 'html',
          header: '',
          style,
          targetStyles: ['*'],
          ignoreElements: ['editFamily', "affix1", "affix2"]
        });
        //各个配置项
        //printable:要打印的id。
        //type:可以是 html 、pdf、 json 等。
        //properties:是打印json时所需要的数据属性。
        //gridHeaderStyle和gridStyle都是打印json时可选的样式。
        //repeatTableHeader:在打印JSON数据时使用。设置为时false，数据表标题将仅在第一页显示。
        //scanStyles:设置为false时，库将不处理应用于正在打印的html的样式。使用css参数时很有用，此时自己设置的原来想要打印的样式就会失效，在打印预览时可以看到效果
        //targetStyles: [’*’],这样设置继承了页面要打印元素原有的css属性。
        //style:传入自定义样式的字符串，使用在要打印的html页面 也就是纸上的样子。
        //ignoreElements：传入要打印的div中的子元素id，使其不打印。非常好用
      },
      resetknlx2() {
        // console.log(this.formData.knlx2)
        this.formData.knlx2 = ""
        // console.log(this.formData.knlx2)
      },
      getApplyxq(id) {
        getApply(id).then(response => {
          this.formData = {
            ...this.formData,
            ...response.data
          }
        })
      },
      handleAffix(affixId) {
        this.formData.affixId = affixId;
      },
      inputHandler() {
        if (this.formData.step == 1) { //学生不允许根据学号查询数据
          return
        }
        this.formData.xh = this.formData.xh.replace(" ", "")
        if (this.formData.xh.length >= 10) {
          getStuByXh({
            xh: this.formData.xh
          }).then(res => {
            this.formData.sfzhm = res.data.idCard
            this.formData.xm = res.data.name
            this.formData.xb = res.data.gender
            this.formData.csny = res.data.birthday
            this.formData.jtxjzdz = res.data.address
            var arr = res.data.srsFemilyMenberList
            if (this.formData.jtcyObj.length <= 1) {
              for (var i = 0; i < arr.length; i++) {
                var obj = {}
                obj.xm = arr[i].kinsfolkName
                obj.nl = arr[i].fatehrAge
                obj.gx = arr[i].kinsfolkRelate
                obj.gzdw = arr[i].workUnit
                obj.zy = arr[i].duty
                obj.jkzk = arr[i].healthCondition
                this.formData.jtcyObj.push(obj)
              }
            }

          })
        }


      },
      doUpdateSignature(){
        updateSignature(this.user).then(res=>{});
      },
      fdySave(){
        this.formData.jtcy = JSON.stringify(this.formData.jtcyObj);
          this.formData.step = 2;
           fdySave(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("提交成功");
       
 
                  this.$tab.closePage();
                  
                }
           })
      },
      onSubmit(stu) { //提交申请
        // console.log(stu)
        // console.log(this.formData.parentstel)

        this.$refs['formData'].validate((valid) => {
          if (valid) {
            if (stu == 1) { //新增认定
              this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
              this.formData.step = stu
              if (!this.formData.sqrqm) {
                Message({
                  message: '请上传签名图片',
                  type: 'error'
                })
                return
              }
    
              addApply(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("提交成功");
                  this.user.signature = this.formData.sqrqm;
                  this.doUpdateSignature();
                  this.$tab.closePage();
                  
                }
              })
            } 
            else if (stu == 0) { //保存信息
              // if (!this.formData.affixId) {
              //   Message({
              //     message: '请上传佐证材料',
              //     type: 'error'
              //   })
              //   return
              // }
              this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
              this.formData.step = stu
              addApply(this.formData).then(res => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("保存成功");
                  this.user.signature = this.formData.sqrqm;
                  this.doUpdateSignature();
                  this.$tab.closePage();
                }
              })
            } else {
              if (stu == 2) {
                if (!this.formData.fdyqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  })
                  return
                }
                if (!this.formData.bjpyyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  })
                  return
                }
                  this.user.signature = this.formData.fdyqm;
              
              }
              if (stu == 3) {
                if (!this.formData.ejxyldqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  })
                  return
                }
                if (!this.formData.ejxyldqmyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  })
                  return
                }
                 this.user.signature = this.formData.ejxyldqm;
               
              }
              if (stu == 4) {
                if (!this.formData.xsqm) {
                  Message({
                    message: '请上传签名图片',
                    type: 'error'
                  })
                  return
                }
                if (!this.formData.xsqmyj) {
                  Message({
                    message: '请确认认定困难类型',
                    type: 'error'
                  })
                  return
                }
                  this.user.signature = this.formData.xsqm;
               
              }
              // if(this.formData.xsqmyj=='4'){

              // }
              this.$refs['formData'].validate((valid) => { //编辑
                if (valid) {
                  this.formData.jtcy = JSON.stringify(this.formData.jtcyObj)
                  this.formData.step = stu + 1;
                  updateApply(this.formData).then(res => {
                    if (res.code == 200) {
                      this.$modal.msgSuccess("提交成功");
                      // if(this.data.length>1){
                      //   console.log(this.data.length)
                      //   console.log(this.indexs)
                      //   if(this.data.length-1==this.indexs){
                      //     this.$modal.msgSuccess("提交成功");
                      //     this.$tab.closePage();
                      //   }else{
                      //     this.$modal.msgSuccess("提交成功，下一个");
                      //     this.getApplyxq(this.data[this.indexs+1].id)
                      //     this.indexs=this.indexs+1
                      //     console.log(this.indexs)
                      //   }
                      // }else{
                      //   this.$modal.msgSuccess("提交成功");
                      this.doUpdateSignature();
                      this.$tab.closePage();
                      // }
                    }
                  })
                } else {
                  return false
                }
              })
            }
          } else {
            return false
          }
        })
      },

      handleAddRow() {
        if (this.formData.step != 1) {
          return
        }
        this.formData.jtcyObj.push({
          xm: "",
          nl: "",
          yxsgx: "",
          gzdw: "",
          zy: "",
          nsr: "",
          jkzk: "",
          gx: "",
          dw: ""
        })
      },
      handelIndex({
        row,
        rowIndex
      }) {
        row.index = rowIndex
        this.index = rowIndex
      },
      handelDel(row) {
        if (this.formData.step != 1) {
          return
        }
        if (this.formData.jtcyObj.length > 1) {
          this.formData.jtcyObj.splice(row.index, 1)
        } else {
          this.$message.error('至少保留一行')
        }
      },
      handleSignatureSuccess(response, file, fileList) {
        this.formData.sqrqm = response.fileName;
      },
      handleFdySignatureSuccess(response, file, fileLis) {
        this.formData.fdyqm = response.fileName;
      },
      handleEjxyldSignatureSuccess(response, file, fileLis) {
        this.formData.ejxyldqm = response.fileName;
      },
      handleXuexiaoSignatureSuccess(response, file, fileLis) {
        this.formData.xsqm = response.fileName;
      },
      //审核不通过
      no() {
        let step = this.formData.step;
        this.$prompt('请输入不通过原因', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',

        }).then(({
          value
        }) => {
          if (value != null && value != "") {
            // console.log()
            let params = {
              "remark": value,
              "step": this.formData.step,
              "applyId": this.formData.id,
              "status": "0",
            }
            nopass(params).then(response => {
              this.$modal.msgSuccess("操作成功");
              this.formData.step = this.formData.step + 1;
            });
          } else {
            this.$modal.msgError("请输入原因");
          }
        });
      },

    },
    computed: {
      income: function() {
        // return this.formData.jtcyObj.length
        let total = 0
        for (var i = 0; i < this.formData.jtcyObj.length; i++) {
          total += Number(this.formData.jtcyObj[i].nsr)
        }
        return this.formData.jtnsr = total.toFixed(2);
      },
      capita: function() {
        return this.formData.rjnsr = parseFloat(this.formData.jtnsr / this.formData.rkzs).toFixed(2)
      },
    }
  }
</script>

<style scoped>
  /* 强制打印背景颜色/图像 */
  * {
    -webkit-print-color-adjust: exact !important;
    /* Chrome, Safari */
    color-adjust: exact !important;
    /*Firefox*/
  }

  .rl {
    writing-mode: vertical-rl;
  }

  .form-blok {
    margin: 0 auto;
    width: 880px;
    /* border: 1px solid #ebebeb; */
    border-radius: 3px;
    transition: .2s;
  }

  .source {
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;

  }

  /* 表格样式 */
  .full-width {
    border-collapse: collapse;
    width: 100%;
  }

  .full-width2 {
    border-collapse: collapse;
    width: 100%;
  }

  td {
    padding: 8px 4px;
    min-width: 100px;
    /* max-width: 110px; */
    box-sizing: border-box;
    text-overflow: ellipsis;
    vertical-align: middle;
    position: relative;
    text-align: center;
    border: 1px solid #000;
  }

  .table-label {
    width: 100px;
    background: #ededed;

  }

  .table-input {
    min-width: 100px;
    padding: 8px 4px;
  }

  .table-align-left {
    padding: 8px 4px;
    text-align: left;
  }

  /* 学院专业班级信息 */
  .class-info {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;

  }

  .class-info>>>.el-input__inner {
    padding: 0px
      /* text-align: right; */
  }

  .class-info div {
    height: 25px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .class-info div span {
    line-height: 25px;
  }

  /* 输入样式统一 */
  /deep/ .el-input__inner {
    border-width: 0px;
    padding: 0px;
    text-align: center
  }

  /* 表单样式统一 */
  /deep/ .el-form-item {
    margin-bottom: 0;
  }

  /deep/ .el-textarea__inner {
    border-width: 0px;
  }

  /deep/ .el-date-editor {
    width: 140px;
  }

  /deep/ .el-form-item__error {
    padding-left: 4px;
    position: relative;
    text-align: left;

  }

  .radio-group /deep/ .el-radio-group {
    width: 180px;

  }

  /*  */
  .radio-group-row {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-content: center;
    font-size: 14px;
    line-height: 20px;

  }

  .signature {
    display: flex;
    flex-direction: row;
    justify-content: right;
    align-content: center;
    margin-right: 20px;
    flex-wrap: wrap;
  }

  .signature span {
    display: block;
    min-width: 50px;
    /* height: 36px;
        line-height: 36px; */
  }

  .signature>div {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
  }

  .avatar {
    width: 117px;
    height: 156px;
  }

  /deep/ .el-upload {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .image-input {
    padding: 0;
    width: 120px;
    height: 160px;
  }

  .signature-img {
    width: 160px;
    height: 50px;
  }

  .signature-tip {
    width: 160px;
    cursor: pointer;
    color: #1890ff;
    text-align: left;

  }


  .qm {
    display: flex;
    flex-direction: column;
    align-content: center;

  }

  .qm>span {

    text-align: left;
    padding-left: 12px;
  }

  .qm>div {

    text-align: right;
    padding-right: 12px;
  }

  .qm>.avatar-uploader {
    padding: 12px 0px;
    text-align: center;
  }

  /deep/ .el-input.is-disabled .el-input__inner {
    background-color: #fff;
    color: #000;
    padding: 0;
    align-items: center;
  }

  /deep/ .el-radio.is-disabled .is-checked .el-radio__inner {
    background-color: #67c23a;
  }


  .list .item {
    display: flex;
    flex-direction: row;
    justify-content: left;
  }

  .list .item span {
    padding: 10px;
  }

  .cm-affix {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
  }

  .record ul {
    padding-inline-start: 0px !important;
  }

  .record .title {
    padding: 20px 0px;
  }
  .red-tip{
    display: inline-block;
    font-size: 14px;
    padding: 0px 5px;
    height: 17px;
    line-height: 17px;
    color: red;
  }
</style>
